<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@include file="/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<fmt:bundle basename="res">
<head>
    <meta charset="utf-8">
    <title><fmt:message key='lb'/></title>
    <jsp:include page="/WEB-INF/commons/commons-header.jsp" flush="true"/>
</head>
<body>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto">

            <div class="layui-form-item">
                <form name="totalForm" id="totalForm" action="${web_domain}/mall/groupBooking/open/list" method="get">

                    <div class="layui-inline">
                        <label class="layui-form-label"><fmt:message key='ptbh'/></label>
                        <div class="layui-input-inline">
                            <input type="text" name="groupBookingNo" placeholder="<fmt:message key='qsrptbh'/>" value="<c:if test='${params.groupBookingNo !=null}'>${params.groupBookingNo}</c:if>" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label"><fmt:message key='spmc'/></label>
                        <div class="layui-input-inline">
                            <input type="text" name="sku.goods.name" placeholder="<fmt:message key='qsrspmc'/>" value="<c:if test='${params.sku.goods.name !=null}'>${params.sku.goods.name}</c:if>" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label"><fmt:message key='sjmc'/></label>
                        <div class="layui-input-inline">
                            <input type="text" name="merchant.shopName" placeholder="<fmt:message key='qsrsjmc'/>" value="<c:if test='${params.merchant.shopName !=null}'>${params.merchant.shopName}</c:if>" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label"><fmt:message key='tzmc'/></label>
                        <div class="layui-input-inline">
                            <input type="text" name="member.nickname" placeholder="<fmt:message key='qsrtzmc'/>" value="<c:if test='${params.member.nickname !=null}'>${params.member.nickname}</c:if>" autocomplete="off" class="layui-input">
                        </div>
                    </div>


                    <div class="layui-inline">
                        <button class="layui-btn layui-btn-sm layuiadmin-btn-list" id="search"><i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> <fmt:message key='ss'/></button>
                    </div>
                </form>
            </div>
        </div>

    </div>

    <div class="layui-card">
        <div class="layui-field-box layui-form">

            <table class="layui-table" lay-size="sm">
                <thead>
                <th><fmt:message key='xh'/></th>
                <th><fmt:message key='ptbh'/></th>
                <th><fmt:message key='sjmc'/></th>
                <th><fmt:message key='spmc'/></th>
                <th><fmt:message key='ptjg'/></th>
                <th><fmt:message key='tzmc'/></th>
                <th><fmt:message key='sjh'/></th>
                <th><fmt:message key='ktsj'/></th>
                <th><fmt:message key='ctrs'/></th>
                <th><fmt:message key='sjctrs'/></th>
                <th><fmt:message key='ctzt'/></th>
                <th><fmt:message key='sfct'/></th>
                <th><fmt:message key='cz'/></th>
                </thead>
                <c:forEach items="${page.result}" var="item" varStatus="status">
                    <tr>
                        <td>${status.index + 1}</td>
                        <td>${item.groupBookingNo }</td>
                        <td>${item.merchant.shopName }</td>
                        <td>${item.sku.goods.name }</td>
                        <td>${item.sku.groupBookingPrice }</td>
                        <td>${item.member.nickname }</td>
                        <td>${item.member.mobile }</td>
                        <td><fmt:formatDate value="${item.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
                        <td>${item.groupBookingCondition }</td>
                        <td>${item.groupBookingTotal }</td>
                        <td>
                            <c:choose>
                                <c:when test="${item.status eq 1}"><fmt:message key='ptz'/></c:when>
                                <c:when test="${item.status eq 2}"><fmt:message key='ptcg'/></c:when>
                                <c:when test="${item.status eq 3}"><fmt:message key='ptsb'/></c:when>
                            </c:choose>
                        </td>
                        <td>${(item.groupBookingTotal ==  item.groupBookingCondition) ? '<fmt:message key='s'/>' : '<fmt:message key='f'/>'}</td>
                        <td>
                            <div class="layui-btn-container">
                                <a href="javascript:void(0);" data-id="${item.id}" class="layui-btn layui-btn-xs feijin-detail"><fmt:message key='ck'/></a>
                            </div>
                        </td>
                    </tr>
                </c:forEach>
            </table>
            <jsp:include page="/commons/page.jsp" flush="true"/>
        </div>
    </div>

</div>

<script>

    $(function () {

        layui.use(['form', 'laydate'], function () {

            var form = layui.form;
            var laydate = layui.laydate;


            //查看详情
            $(".feijin-detail").click(function () {

                var id = $(this).attr("data-id");

                layer.open({
                    type: 2
                    , title: '<fmt:message key='ckxq'/>'
                    , content: '${web_domain}/mall/groupBooking/open/' + id + '/detail'
                    , maxmin: true
                    , area: ['97%', '97%']
                    , btn: ['<fmt:message key='fh'/>']
                });
            });

        });
    });
</script>
</body>
</fmt:bundle>
</html>